use crate::{client::RedisClient, resp::Command, RedisResult};

impl RedisClient {
    pub async fn zset_zadd(&self, key: &str, score: isize, member: &str) -> RedisResult<usize> {
        let cmd = Command::new_with_key("ZADD", key).arg(score).arg(member);
        self.send_command(cmd).await
    }

    pub async fn zset_zcard(&self, key: &str) -> RedisResult<usize> {
        let cmd = Command::new_with_key("ZCARD", key);
        self.send_command(cmd).await
    }

    pub async fn zset_zcount(&self, key: &str, min: &str, max: &str) -> RedisResult<usize> {
        let cmd = Command::new_with_key("ZCOUNT", key).arg(min).arg(max);
        self.send_command(cmd).await
    }

    pub async fn zset_zdiff(&self, keys: &[&str]) -> RedisResult<Vec<String>> {
        let cmd = Command::new_with_keys("ZDIFF", keys);
        self.send_command(cmd).await
    }
}
